REM --download and --local-install both indicates a network install
REM --no-shortcuts means do not install any shortcuts for desktop or startmenu

CALL "%~dp0env.cmd"

SET target_dir=%root_dir%\_files\cygwin
SET cache_dir=%TEMP%
SET mirror="http://mirrors.ustc.edu.cn/cygwin/"
SET setup_prog=%bin_dir%\cyg_setup.exe

SET /p do_setup="cygwin auto install will start, continue? [y/n]"
IF /I not %do_setup%==y exit 1

%setup_prog% --upgrade-also --no-admin --quiet-mode ^
    --download --local-install --no-shortcuts ^
    --local-package-dir %cache_dir% --root %target_dir% ^
    --site %mirror% --only-site ^
    --packages ^
chere,mintty,bash,ncurses,vim,^
cygrunsrv,cygutils,makepasswd,^
man,texinfo,less,file,which,^
util-linux,coreutils,findutils,diffutils,^
sed,grep,dos2unix,libiconv,md5deep,^
tar,bsdtar,cabextract,gzip,bzip2,xz,p7zip,^
python,python3,python3-requests,^
perl,gawk,^
w3m,wget,rsync,openssh,autossh,^
git,gcc-g++,make,mingw-gcc-g++,binutils,gcc-fortran,^
optipng,ImageMagick,^
python-sphinx

COPY /Y %scripts_dir%\Cygwin.bat %target_dir%
